<template>
    <div>
        <switch-tab @switch="switchItem" :switches="switches" :currentIndex="currentIndex">
            <div v-show="currentIndex===0">
                第一个选项卡的内容
            </div>
            <div  v-show="currentIndex===1">
                第二个选项卡的内容
            </div>
            <div  v-show="currentIndex===2">
                第三个选项卡的内容
            </div>
        </switch-tab>
    </div>
</template>

<script type="text/ecmascript-6">
import SwitchTab from 'base/switch-tab/switch-tab'
export default {
    data() {
        return {
            currentIndex:0,
            switches:[
                {name:"标签一"},
                {name:"标签二"},
                {name:"标签三"}
            ]
        }
    },
    methods:{
        switchItem(index){
            this.currentIndex=index
        }
    },
    components:{
        SwitchTab
    }
}
</script>

<style scoped lang="stylus" rel="stylesheet/stylus">
@import '~common/stylus/variable';
</style>
